package org.groupg.filetodb.util;

import java.lang.management.ManagementFactory;
import java.lang.management.RuntimeMXBean;

public class JavaRuntimeUtils {
    static RuntimeMXBean runtimeMXBean = ManagementFactory.getRuntimeMXBean();

    /**
     * 判断是否是 DEBUG 模式，如果是则返回 true
     * @return 是否处于 debug 模式下
     */
    public static boolean isDebug() {
        return runtimeMXBean.getInputArguments().toString().indexOf("-agentlib:jdwp") > 0;
    }
}
